<template>
 <p>{{ obj }}</p>
 <button @click="addAge">加一岁</button>
</template>
<style scoped>
  
</style>

<script setup lang="ts">
import { reactive } from "vue";
  const obj =reactive( {
    name:'张三',
    age:18
  })
  const addAge = ()=>{
    obj.age++
    console.log(obj)
  }
</script>